package World.Module.Code;

import Collections.UnOrderMultiMapSet;
import World.ISingletonAwakeOne;
import World.Singleton;
import java.util.HashMap;
import java.util.HashSet;

public class CodeTypes extends Singleton implements ISingletonAwakeOne<Package[]> {

    private final HashMap<String, Class<?>> allTypes = new HashMap<>();
    private final UnOrderMultiMapSet<Class<?>, Class<?>> types = new UnOrderMultiMapSet<>();

    @Override
    public void Awake(Package[] packages) {

    }

    public HashSet<Class<?>> GetTypes(Class<?> systemAttributeType)
    {
        if (!this.types.ContainsKey(systemAttributeType))
        {
            return new HashSet<>();
        }
        return this.types.Get(systemAttributeType);
    }

    public HashMap<String, Class<?>> GetTypes()
    {
        return allTypes;
    }

    public Class<?> GetType(String typeName)
    {
        return this.allTypes.get(typeName);
    }

    public void CreateCode()
    {
        //TODO
    }
}
